package site.jlopen.components.entity;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import lombok.Data;

@Data
public class GraphNodeParam {

	private Long projectId;
	private Long flowId;
	private String graphId;
	private Long paramId;
	private String name;
	private String domain;
	private String code;
	private String desc;
	private String version;
	List<GraphNodeAttr> attrs = new ArrayList<GraphNodeAttr>();
	List<GraphNodeInputOutput> inds = new ArrayList<GraphNodeInputOutput>();
	List<GraphNodeInputOutput> outds = new ArrayList<GraphNodeInputOutput>();
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		GraphNodeParam other = (GraphNodeParam) obj;
		return Objects.equals(attrs, other.attrs) && Objects.equals(code, other.code)
				&& Objects.equals(desc, other.desc) && Objects.equals(domain, other.domain)
				&& Objects.equals(flowId, other.flowId) && Objects.equals(graphId, other.graphId)
				&& Objects.equals(inds, other.inds) && Objects.equals(name, other.name)
				&& Objects.equals(outds, other.outds) && Objects.equals(paramId, other.paramId)
				&& Objects.equals(projectId, other.projectId) && Objects.equals(version, other.version);
	}
	
	@Override
	public int hashCode() {
		return Objects.hash(attrs, code, desc, domain, flowId, graphId, inds, name, outds, paramId, projectId, version);
	}
	
	
}
